(function(jQuery) {
	var quick_search_gridId;
	var quick_search_url;
	
	/*
	 * 高级查询JS插件
	 */
	
	$.QuickSearchUtils = {
			
			/**
			 * 记录查询条件
			 */
			recordQuickCond : function(columnName, columnType, condition, value1, value2, dataDicValue) {

				var bExist = false;
				
				for(var i=0;i<window.arrayQuickSrch.length;i++) {
				    var item = window.arrayQuickSrch[i];

				    if (item.gridId == quick_search_gridId) {
						var quickSrchCondition = item;
						quickSrchCondition.columnName = columnName;
						quickSrchCondition.columnType = columnType;
						quickSrchCondition.condition = condition;
						quickSrchCondition.value1 = value1;
						quickSrchCondition.value2 = value2;
						quickSrchCondition.dataDicValue = dataDicValue;
						
						bExist = true;
						break;
					}
				}
				
				if (!bExist) {
					var quickSrchCondition = new Object();
					quickSrchCondition.gridId = quick_search_gridId;
					quickSrchCondition.columnName = columnName;
					quickSrchCondition.columnType = columnType;
					quickSrchCondition.condition = condition;
					quickSrchCondition.value1 = value1;
					quickSrchCondition.value2 = value2;
					quickSrchCondition.dataDicValue = dataDicValue;
					
					window.arrayQuickSrch.push(quickSrchCondition);
					
				}
				
			},
			
			/**
			 * 根据查询条件刷新DataGrid
			 */
			refreshDataGrid : function() {
				// WHERE 条件
				var whereStr = "";
				var columnName = $("#quick_search_colName").combobox('getValue');
				var columnType = $.QuickSearchUtils.getColType();
				var condition = $("#quick_search_compare").combobox('getValue');
				var value1;
				var value2;
				var dataDicValue;
				
				if ($('#div_quick_search_colValue1').css("display")!="none") {
					var validate = $('#quick_search_colValue1').validatebox("isValid");
					if (!validate) {
						return false;
					} else {
						value1 = $("#quick_search_colValue1").val();
					}
				}
				
				if ($('#div_quick_search_colValue2').css("display")!="none") {
					var validate = $('#quick_search_colValue2').validatebox("isValid");
					if (!validate) {
						return false;
					} else {
						value2 = $("#quick_search_colValue2").val();
					}
				}
				
				if ($('#div_quick_search_dateFrom').css("display")!="none") {
					var validate = $('#quick_search_dateFrom').datebox("isValid");
					if (!validate) {
						return false;
					} else {
						value1 = $("#quick_search_dateFrom").datebox('getValue');
					}
				}
				
				if ($('#div_quick_search_dateTo').css("display")!="none") {
					var validate = $('#quick_search_dateTo').datebox("isValid");
					if (!validate) {
						return false;
					} else {
						value2 = $("#quick_search_dateTo").datebox('getValue');
					}
				}
				
				if ($('#div_quick_search_dateTimeFrom').css("display")!="none") {
					var validate = $('#quick_search_dateTimeFrom').datetimebox("isValid");
					if (!validate) {
						return false;
					} else {
						value1 = $("#quick_search_dateTimeFrom").datetimebox('getValue');
					}
				}
				if ($('#div_quick_search_dateTimeTo').css("display")!="none") {
					var validate = $('#quick_search_dateTimeTo').datetimebox("isValid");
					if (!validate) {
						return false;
					} else {
						value2 = $("#quick_search_dateTimeTo").datetimebox('getValue');
					}
				}
				if ($('#div_quick_search_dataDic').css("display")!="none") {
					var validate = $('#quick_search_dataDic').combobox("isValid");
					if (!validate) {
						return false;
					} else {
						dataDicValue = $("#quick_search_dataDic").combobox('getValue');
					}
				}

				// 记录查询条件
				$.QuickSearchUtils.recordQuickCond(columnName, columnType, condition, value1, value2, dataDicValue);
				
				// 实施查询
				whereStr = $.QuickSearchUtils.cerateSQLWhere(columnName, columnType, condition, value1, value2, dataDicValue);
				
				// 设置URL
				$(quick_search_gridId).datagrid('options').url = quick_search_url;
				
				// 设置参数
				var param = {};
				param.conditions = encodeURI(whereStr);
				param.Login_SessionId = sessionId;
				param.readOnly = 'YES';
				
				// 请求数据
				$(quick_search_gridId).datagrid("load", param);
				$(quick_search_gridId).datagrid("clearSelections");
				
				$("#quick_search_window").window('close');
				
			},
			
			/**
			 * 生成一行的WHERE 条件
			 */
			cerateSQLWhere : function(colName, columnType, condition, value1, value2, dataDicValue) {
				var whereStr = null;
				
				var columnName = "{" + colName + "}"
				
				switch (condition) {
				case "等于" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') = '" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = columnName + " = '" + value1 + "'";
						break;
					case "CHAR" :
						if (dataDicValue != null) {
							whereStr = columnName + " = '" + dataDicValue + "' ";
						} else {
							whereStr = columnName + " = '" + value1 + "' ";
						}
						break;
					case "NUMBER" :
						whereStr = columnName + " = " + value1;
						break;
					}
					
					break;
				case "不等于" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') <> '" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') <> '" + value1 + "'";
						break;
					case "CHAR" :
						if (dataDicValue != null) {
							whereStr = columnName + " <> '" + dataDicValue + "' ";
						} else {
							whereStr = columnName + " <> '" + value1 + "' ";
						}
						break;
					case "NUMBER" :
						whereStr = columnName + " <> " + value1;
						break;
					}
					break;
					
				case "大于" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') > '" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') > '" + value1 + "'";
						break;
					case "CHAR" :
						whereStr = columnName + " > '" + value1 + "' ";
						break;
					case "NUMBER" :
						whereStr = columnName + " > " + value1;
						break;
					}
					break;
					
				case "大于等于" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') >= '" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') >= '" + value1 + "'";
						break;
					case "CHAR" :
						whereStr = columnName + " >= '" + value1 + "' ";
						break;
					case "NUMBER" :
						whereStr = columnName + " >= " + value1;
						break;
					}
					break;
					
				case "小于" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') < '" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') < '" + value1 + "'";
						break;
					case "CHAR" :
						whereStr = columnName + " < '" + value1 + "' ";
						break;
					case "NUMBER" :
						whereStr = columnName + " < " + value1;
						break;
					}
					break;

				case "小于等于" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') <= '" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') <= '" + value1 + "'";
						break;
					case "CHAR" :
						whereStr = columnName + " <= '" + value1 + "' ";
						break;
					case "NUMBER" :
						whereStr = columnName + " <= " + value1;
						break;
					}
					break;

				case "为空" :
					whereStr = columnName + " IS NULL ";
					break;

				case "不为空" :
					whereStr = columnName + " IS NOT NULL ";
					break;
					
				case "包含" :
					var inStr = value1.replace(new RegExp(",","gm"), "','");
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') IN ('" + inStr + "')";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') IN ('" + inStr + "')";
						break;
					case "CHAR" :
						whereStr = columnName + " IN ('" + inStr + "') ";
						break;
					case "NUMBER" :
						whereStr = columnName + " IN (" + inStr + ")";
						break;
					}
					break;

				case "不包含" :
					var inStr = value1.replace(new RegExp(",","gm"), "','");
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') NOT IN ('" + inStr + "')";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') NOT IN ('" + inStr + "')";
						break;
					case "CHAR" :
						whereStr = columnName + " NOT IN ('" + inStr + "') ";
						break;
					case "NUMBER" :
						whereStr = columnName + " NOT IN (" + inStr + ")";
						break;
					}
					break;

				case "全模糊" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') LIKE '%" + value1 + "%'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') LIKE '%" + value1 + "%'";
						break;
					case "CHAR" :
						whereStr = columnName + " LIKE '%" + value1 + "%'";
						break;
					case "NUMBER" :
						whereStr = columnName + " LIKE '%" + value1 + "%'";
						break;
					}
					break;

				case "左模糊" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') LIKE '%" + value1 + "'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') LIKE '%" + value1 + "'";
						break;
					case "CHAR" :
						whereStr = columnName + " LIKE '%" + value1 + "'";
						break;
					case "NUMBER" :
						whereStr = columnName + " LIKE '%" + value1 + "'";
						break;
					}
					break;
					
				case "右模糊" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') LIKE '" + value1 + "%'";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') LIKE '" + value1 + "%'";
						break;
					case "CHAR" :
						whereStr = columnName + " LIKE '" + value1 + "%'";
						break;
					case "NUMBER" :
						whereStr = columnName + " LIKE '" + value1 + "%'";
						break;
					}
					break;

				case "介于...之间" :
					switch (columnType) {
					case "DATE" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d') BETWEEN '" + value1 + "' AND '" + value2 + "' ";
						break;
					case "DATETIME" :
						whereStr = "DATE_FORMAT(" + columnName + ",'%Y-%m-%d %H:%i:%s') BETWEEN '" + value1 + "' AND '" + value2 + "' ";
						break;
					case "CHAR" :
						whereStr = columnName + " BETWEEN '" + value1 + "' AND '" + value2 + "' ";
						break;
					case "NUMBER" :
						whereStr = columnName + " BETWEEN " + value1 + " AND " + value2 + " ";
						break;
					}
					break;
				}
				
				return whereStr;
				
			},
			
			/**
			 * 清空预定义查询条件
			 */
			resetPreDefineCondition : function() {
				// Clear Condition DataGrid
				
				// Clear Condition edit area
				$("#quick_search_colValue1").val("");
				$("#quick_search_colValue2").val("");
				$("#quick_search_dateFrom").datebox('setValue' ,'');
				$("#quick_search_dateTimeFrom").datebox('setValue' ,'');
				$("#quick_search_dateTo").datebox('setValue' ,'');
				$("#quick_search_dateTimeTo").datebox('setValue' ,'');
				$("#quick_search_dataDic").combobox('select' ,'');
				
			},			
			
			
			/**
			 * 获得列类型
			 */
			getColType : function() {
				var columnName = $("#quick_search_colName").combobox('getValue');
				var colDatas = $("#quick_search_colName").combobox('getData');
				var columnType;
				for (var i = 0; i < colDatas.length; i++) {
					if (columnName == colDatas[i].columnName) {
						columnType = colDatas[i].type;
						break;
					}
				}
				
				// 返回
				return columnType;
			},		
			
			
			/**
			 * 创建比较符数据
			 */
			createCompareSigns : function() {
				var signLst = [{
								name: '等于',
								value:  '等于'
							  },{
									name: '不等于',
									value:  '不等于'
							  },{
									name: '大于',
									value:  '大于'
							  },{
									name: '大于等于',
									value:  '大于等于'
							  },{
									name: '小于',
									value:  '小于'
							  },{
									name: '小于等于',
									value:  '小于等于'
							  },{
									name: '为空',
									value:  '为空'
							  },{
									name: '不为空',
									value:  '不为空'
							  },{
									name: '包含',
									value:  '包含'
							  },{
									name: '不包含',
									value:  '不包含'
							  },{
									name: '全模糊',
									value:  '全模糊'
							  },{
									name: '左模糊',
									value:  '左模糊'
							  },{
									name: '右模糊',
									value:  '右模糊'
							  },{
									name: '介于...之间',
									value:  '介于...之间'
							  }];
				
				// 返回
				return signLst;
			},
			
	
		/**
		 * 页面初始化函数
		 */
		init : function(colLst, gridId, url) {
			// 保存DataGrid ID及URL
			quick_search_gridId = gridId;
			quick_search_url = url;
			var dataDicCode = null;
			var quickSrchCondition = null;
			for(var i=0;i<window.arrayQuickSrch.length;i++) {
			    var item = window.arrayQuickSrch[i];
				if (item.gridId == quick_search_gridId) {
					quickSrchCondition = item;
					break;
				}
			}

			// 初始化列名下拉框
			/**
			 * 传过来的列定义形式
			var colLst = [{
				columnName: '订单编号',
				type:  'CHAR'
			  },{
				  columnName: '建档号',
					type:  'NUMBER'
			  },{
				  columnName: '日期',
					type:  'DATE'
			  },{
				  columnName: '创建时间',
					type:  'DATETIME'
			  }];
			  **/
			$('#quick_search_colName').combobox({
				data: colLst,
			    valueField:'columnName',
			    textField:'columnName',
			    editable: false,
			    value: colLst[0].columnName,
			    
				onSelect: function(data){
					var columnType = data.type;
					var sign = $('#quick_search_compare').combobox('getValue');
					dataDicCode = data.codeType;
					var whereStr = null;
					if (sign == "为空" || sign == "不为空") {
						$("#div_quick_search_colValue1").css("display","none");
						$("#div_quick_search_colValue2").css("display","none");
						$("#div_quick_search_dateFrom").css("display","none");
						$("#div_quick_search_dateTo").css("display","none");
						$("#div_quick_search_dateTimeFrom").css("display","none");
						$("#div_quick_search_dateTimeTo").css("display","none");
						$("#div_quick_search_dataDic").css("display","none");
						return true;
					}
					switch (columnType) {
					case "DATE":
						if (sign == "介于...之间") {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","block");
							$("#div_quick_search_dateTo").css("display","block");
							$("#div_quick_search_dateTimeFrom").css("display","none");
							$("#div_quick_search_dateTimeTo").css("display","none");
							$("#div_quick_search_dataDic").css("display","none");
						} else {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","block");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","none");
							$("#div_quick_search_dateTimeTo").css("display","none");
							$("#div_quick_search_dataDic").css("display","none");
						}
						break;
					case "DATETIME":
						if (sign == "介于...之间") {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","none");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","block");
							$("#div_quick_search_dateTimeTo").css("display","block");
							$("#div_quick_search_dataDic").css("display","none");
						} else {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","none");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","block");
							$("#div_quick_search_dateTimeTo").css("display","none");
							$("#div_quick_search_dataDic").css("display","none");
						}
						break;

					default:
						if (dataDicCode != null && (sign == "等于" || sign == "不等于")) {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","none");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","none");
							$("#div_quick_search_dateTimeTo").css("display","none");
							$("#div_quick_search_dataDic").css("display","block");
							
							$.ajax({
								type: 'post',
								url: 'seniorQuery/getDataDicList.do?codeType=' + dataDicCode + '&Login_SessionId=' + sessionId,
								dataType: 'json',
								success :function(retData){
									if (retData != null) {
										var dataList = [];
										$.each(retData, function(i,item){
											dataList.push({"id":this,"text":this});
										});
										var selectValue = dataList[0].id;
										if (quickSrchCondition != null) {
											selectValue = quickSrchCondition.dataDicValue;
										}
										$('#quick_search_dataDic').combobox({
											data: dataList,
											value: selectValue,
										});
									}
								}
							});
						} else {
							$("#div_quick_search_dataDic").css("display","none");
							if (sign == "介于...之间") {
								$("#div_quick_search_colValue1").css("display","block");
								$("#div_quick_search_colValue2").css("display","block");
								$("#div_quick_search_dateFrom").css("display","none");
								$("#div_quick_search_dateTo").css("display","none");
								$("#div_quick_search_dateTimeFrom").css("display","none");
								$("#div_quick_search_dateTimeTo").css("display","none");
							} else {
								$("#div_quick_search_colValue1").css("display","block");
								$("#div_quick_search_colValue2").css("display","none");
								$("#div_quick_search_dateFrom").css("display","none");
								$("#div_quick_search_dateTo").css("display","none");
								$("#div_quick_search_dateTimeFrom").css("display","none");
								$("#div_quick_search_dateTimeTo").css("display","none");
							}
						}
						break;	
					}
				}
			});
			
			// 创建比较符数据
			var signLst = $.QuickSearchUtils.createCompareSigns();
			
			// 比较符下拉框
			$('#quick_search_compare').combobox({
				data: signLst,
			    valueField:'value',
			    textField:'name',
			    editable: false,
			    value: signLst[0].value,
			    
				onSelect: function(data){
					var sign = data.value;
					var columnType = $.QuickSearchUtils.getColType();
					
					if (sign == "为空" || sign == "不为空") {
						$("#div_quick_search_colValue1").css("display","none");
						$("#div_quick_search_colValue2").css("display","none");
						$("#div_quick_search_dateFrom").css("display","none");
						$("#div_quick_search_dateTo").css("display","none");
						$("#div_quick_search_dateTimeFrom").css("display","none");
						$("#div_quick_search_dateTimeTo").css("display","none");
						$("#div_quick_search_dataDic").css("display","none");
						return true;
					}
					
					if (sign == "介于...之间") {
						$("#div_quick_search_dataDic").css("display","none");
						if (columnType == "DATE") {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","block");
							$("#div_quick_search_dateTo").css("display","block");
							$("#div_quick_search_dateTimeFrom").css("display","none");
							$("#div_quick_search_dateTimeTo").css("display","none");
						} else if (columnType == "DATETIME"){
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","none");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","block");
							$("#div_quick_search_dateTimeTo").css("display","block");
						} else {
							$("#div_quick_search_colValue1").css("display","inline");
							$("#div_quick_search_colValue2").css("display","inline");
							$("#div_quick_search_dateFrom").css("display","none");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","none");
							$("#div_quick_search_dateTimeTo").css("display","none");
						}
					} else {
						if (columnType == "DATE") {
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","block");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","none");
							$("#div_quick_search_dateTimeTo").css("display","none");
							$("#div_quick_search_dataDic").css("display","none");
						} else if (columnType == "DATETIME"){
							$("#div_quick_search_colValue1").css("display","none");
							$("#div_quick_search_colValue2").css("display","none");
							$("#div_quick_search_dateFrom").css("display","none");
							$("#div_quick_search_dateTo").css("display","none");
							$("#div_quick_search_dateTimeFrom").css("display","block");
							$("#div_quick_search_dateTimeTo").css("display","none");
							$("#div_quick_search_dataDic").css("display","none");
						} else {
							if (dataDicCode != null && (sign == "等于" || sign == "不等于")) {
								$("#div_quick_search_dataDic").css("display","block");
								$("#div_quick_search_colValue1").css("display","none");
								$("#div_quick_search_colValue2").css("display","none");
								$("#div_quick_search_dateFrom").css("display","none");
								$("#div_quick_search_dateTo").css("display","none");
								$("#div_quick_search_dateTimeFrom").css("display","none");
								$("#div_quick_search_dateTimeTo").css("display","none");
								$.ajax({
									type: 'post',
									url: 'seniorQuery/getDataDicList.do?codeType=' + dataDicCode + '&Login_SessionId=' + sessionId,
									dataType: 'json',
									success :function(retData){
										if (retData != null) {
											var dataList = [];
											$.each(retData, function(i,item){
												dataList.push({"id":this,"text":this});
											});
											var selectValue = dataList[0].id;
											if (quickSrchCondition != null) {
												selectValue = quickSrchCondition.dataDicValue;
											}
											$('#quick_search_dataDic').combobox({
												data: dataList,
												value: selectValue,
											});
										}
									}
								});
							} else {
								$("#div_quick_search_colValue1").css("display","block");
								$("#div_quick_search_colValue2").css("display","none");
								$("#div_quick_search_dateFrom").css("display","none");
								$("#div_quick_search_dateTo").css("display","none");
								$("#div_quick_search_dateTimeFrom").css("display","none");
								$("#div_quick_search_dateTimeTo").css("display","none");
								$("#div_quick_search_dataDic").css("display","none");
							}
						}
					}
				}
			});
			
			// 存在历史查询条件
			if (quickSrchCondition != null) {
				$.QuickSearchUtils.setOldContion(quickSrchCondition);
			}
			
		},
		
		/**
		 * 设置历史查询条件
		 */
		setOldContion : function(quickSrchCondition) {
			var sign = quickSrchCondition.condition;
			var columnType = quickSrchCondition.columnType;
			var value1 = quickSrchCondition.value1;
			var value2 = quickSrchCondition.value2;
			
			if (sign == "介于...之间") {
				if (columnType == "DATE") {
					$("#quick_search_dateFrom").datebox('setValue', value1);
					$("#quick_search_dateTo").datebox('setValue', value2);
				} else if (columnType == "DATETIME"){
					$("#quick_search_dateTimeFrom").datetimebox('setValue', value1);
					$("#quick_search_dateTimeTo").datetimebox('setValue', value2);
				} else {
					$("#quick_search_colValue1").val(value1);
					$("#quick_search_colValue2").val(value2);
				}
			} else {
				if (columnType == "DATE") {
					$("#quick_search_dateFrom").datebox('setValue', value1);
				} else if (columnType == "DATETIME"){
					$("#quick_search_dateTimeFrom").datetimebox('setValue', value1);
				} else {
					$("#quick_search_colValue1").val(value1);
				}
			}
			
			$("#quick_search_colName").combobox('select', quickSrchCondition.columnName);
			$("#quick_search_compare").combobox('select', quickSrchCondition.condition);
		}
		
	};	
})(jQuery);

